<template>
  <div class="home">
    <!-- 所有子路由出口 -->
    <keep-alive include="find">
      <router-view></router-view>
    </keep-alive>
    <!-- 底部标签栏-->
    <transition name="animate">
      <van-tabbar
        active-color="#c1002e"
        inactive-color="#b4b4bd"
        route
        class="tabbar"
        placeholder
        v-if="$route.meta.needTabbar"
      >
        <van-tabbar-item to="/home/company">
          <template #default>
            <div class="title">公司</div>
          </template>
          <template #icon>
            <i class="iconfont">&#xe63d;</i>
          </template>
        </van-tabbar-item>
        <van-tabbar-item to="/home/question">
          <template #default>
            <div class="title">刷题</div>
          </template>
          <template #icon>
            <i class="iconfont">&#xe63f;</i>
          </template>
        </van-tabbar-item>
        <van-tabbar-item to="/home/find">
          <template #default>
            <div class="title">发现</div>
          </template>
          <template #icon>
            <i class="iconfont">&#xe646;</i>
          </template>
        </van-tabbar-item>
        <van-tabbar-item to="/home/my">
          <template #default>
            <div class="title">我的</div>
          </template>
          <template #icon>
            <i class="iconfont">&#xe645;</i>
          </template>
        </van-tabbar-item>
      </van-tabbar>
    </transition>
  </div>
</template>

<script>
export default {}
</script>

<style lang="less" scoped>
.home {
  height: 100%;
  .tabbar {
    height: 60px;
  }
  .iconfont {
    font-size: 28px;
  }
  .animate-enter-active {
    transition: all 2s;
  }
  .animate-leave-active {
    transition: all 2s;
  }
  .animate-enter {
    opacity: 0;
  }
  .animate-leave-to {
    opacity: 0;
  }
}
</style>
